PaginationResult

data class PaginationResult<T>(page: Int, pagesNumber: Int, results: List<T>, size: Int) : Pagination

Properties

page
Link copied to clipboard
common
open override val page: Int

Started with 0. Number of page inside of pagination. Offset can be calculated as page * size

pagesNumber
Link copied to clipboard
common
val pagesNumber: Int
results
Link copied to clipboard
common
val results: List<T>
size
Link copied to clipboard
common
open override val size: Int

Can be 0, but can't be < 0 Size of current page. Offset can be calculated as page * size

Extensions

changeResults
Link copied to clipboard
fun <I, O> PaginationResult<I>.changeResults(data: List<O>): PaginationResult<O>
fun <I, O> PaginationResult<I>.changeResults(data: List<O>): PaginationResult<O>
fun <I, O> PaginationResult<I>.changeResults(data: List<O>): PaginationResult<O>
changeResultsUnchecked
Link copied to clipboard
fun <I, O> PaginationResult<I>.changeResultsUnchecked(data: List<O>): PaginationResult<O>
fun <I, O> PaginationResult<I>.changeResultsUnchecked(data: List<O>): PaginationResult<O>
fun <I, O> PaginationResult<I>.changeResultsUnchecked(data: List<O>): PaginationResult<O>
currentPageIfNotEmpty
Link copied to clipboard
inline fun <T> PaginationResult<T>.currentPageIfNotEmpty(): PaginationResult<T>?
inline fun <T> PaginationResult<T>.currentPageIfNotEmpty(): PaginationResult<T>?
inline fun <T> PaginationResult<T>.currentPageIfNotEmpty(): PaginationResult<T>?
nextPageIfNotEmpty
Link copied to clipboard
inline fun PaginationResult<*>.nextPageIfNotEmpty(): SimplePagination?
inline fun PaginationResult<*>.nextPageIfNotEmpty(): SimplePagination?
inline fun PaginationResult<*>.nextPageIfNotEmpty(): SimplePagination?
thisPageIfNotEmpty
Link copied to clipboard
inline fun <T> PaginationResult<T>.thisPageIfNotEmpty(): PaginationResult<T>?
inline fun <T> PaginationResult<T>.thisPageIfNotEmpty(): PaginationResult<T>?
inline fun <T> PaginationResult<T>.thisPageIfNotEmpty(): PaginationResult<T>?